__author__ = 'senata'

class Person:
    person_name = ''
    person_title = []
    person_alias = []
    LABEL_PERSON = 'B-PER'
    LABEL_TITLE = 'B-TITLE'

    def __init__(self, name, title):
        self.person_name = name
        self.person_alias = []
        self.person_title = []
        self.person_alias.append(name)
        self.person_title.extend(title)
        if name.find(" ")>0 :
            temp_alias = name.split(" ")
            for word in temp_alias:
                if len(word.replace('.',''))>1:
                    self.person_alias.append(word)
            initial = [word[0].upper() for word in name.split(" ")]
            self.person_alias.append(''.join(initial))

    def cek_for_aliases(self,name):
        if (self.person_name.find(name)>=0) and (len(self.person_name)!=len(name)):
            if self.person_alias.count(name)<=0:
                self.person_alias.append(name)
            return True
        return False
